home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12672 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  825 b 

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net  (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Rounding a double
  5. Date: 2 Apr 1996 01:25:53 GMT
  6. Organization: Nando.net Public Access
  7. Message-ID: <4jpvn1$h2p@castle.nando.net>
  8. References: <4jprh2$1li@newsgate.dircon.co.uk>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: vyger1409.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4jprh2$1li@newsgate.dircon.co.uk>,
  14. pg-smith@dircon.co.uk (Peter Smith) writes:
  15.  
  16. >Has anybody got a C function to round a double to a number of decimal 
  17. >places that:
  18. >a) is readable
  19. >b) is relatively short
  20. >c) works !!
  21. >I had a function but it failed if the number of decimal places was zero,
  22. >if the double was very small,  .. . etc etc.
  23.  
  24. You forgot to post the code.
  25.  
  26. Bill McCarthy
  27. actuary@nando.net
  28. Wendell, NC  USA
  29.  
  30.